<script setup lang="ts">
import type {NuxtError} from "#app";

defineProps({
  error: Object as () => NuxtError
})
const handleError = () => clearError({redirect: '/'})
</script>

<template>
  <div class="content">
    <h2>{{ error?.statusCode }}</h2>
<pre>
   {{ error?.message }}
   {{ error?.cause }}
</pre>
    <el-button type="info" @click="handleError">回到首页</el-button>
  </div>
</template>

<style scoped>
.content{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
</style>